<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>取货员设置</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  {include file="public/css"/}
</head>
<body>
  <div class="layui-fluid">
    <div class="layui-row layui-col-space15">
      <div class="layui-card layui-col-md12">
                <div class="layui-card-header">
                    {if !$info['id']}<i class="fa fa-plus"></i> 添加取货员{else}<i class="fa fa-pencil"></i> 编辑取货员{/if}
                    <i class="layui-icon layui-icon-close" style="font-size:18px;font-weight:bold;cursor:pointer" onclick="closeself()"></i>
                </div>
                <div class="layui-card-body" pad15>
                    <div class="layui-form">
                        <input type="hidden" name="info[id]" value="{$info.id}"/>
                        <div class="layui-form-item">
                            <label class="layui-form-label">姓名：</label>
                            <div class="layui-input-inline">
                                <input type="text" name="info[realname]" lay-verify="required" lay-verType="tips" class="layui-input" value="{$info.realname}">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">手机号：</label>
                            <div class="layui-input-inline">
                                <input type="text" name="info[tel]" lay-verify="required" lay-verType="tips" class="layui-input" value="{$info.tel}">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">密码：</label>
                            <div class="layui-input-inline">
                                <input type="text" name="info[pwd]" autocomplete="off" class="layui-input" value="" placeholder="留空表示不修改密码">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">状态：</label>
                            <div class="layui-input-inline">
                                <input type="radio" name="info[status]" value="1" title="开启" {if !$info['id'] || $info['status']==1}checked{/if}>
                                <input type="radio" name="info[status]" value="0" title="关闭" {if $info['id'] && $info['status']==0}checked{/if}>
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <div class="layui-input-block">
                                <button class="layui-btn layui-btn-danger" lay-submit lay-filter="formsubmit">提 交</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
  </div>
    {include file="public/js"/}
    <script>
    layui.form.on('submit(formsubmit)', function(obj){
        var field = obj.field

        var index = layer.load();
        $.post("{:url('save')}",field,function(data){
            layer.close(index);
            dialog(data.msg,data.status);
            if(data.status == 1){
                setTimeout(function(){
                    parent.layer.close(parent.layer.getFrameIndex(window.name));
                    parent.tableIns.reload()
                },1000)
            }
        })
    })
  </script>
    {include file="public/copyright"/}
</body>
</html>